﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
namespace Sinacor.Infra.UI.Common
{
    public interface IObservableObject : INotifyPropertyChanged
    {
        bool IsObserverStarted { get; }
        bool HasPropertyChanges { get; }
        bool SpreadChanges { get; set; }

        List<IObservableObject> ParentObjects { get; set; }

        void StartObserver();
        void StopObserver();
        void ClearChanges();

        void SetValue<T>(string propName, ref T field, T value);

        event PropertyChangedEventHandler InternalPropertyChanged;

        event Action<bool> SpreadChangesChanged;

        void OnSpreadChangesChanged(bool newValue);
    }
}
